#include "CtrlSWKNXProgramLed.h"

CtrlSWKNXProgramLed::CtrlSWKNXProgramLed(QObject *parent) :
    BaseCmd(parent)
{
    this->m_protocolType = ProtocolType::SWKNXProtol;
    this->m_functionCode = FunctionCode;
}

void CtrlSWKNXProgramLed::unPackage(Package package)
{

}
Package CtrlSWKNXProgramLed::toPackage()
{
    Package package;
    QByteArray body;



    body.append(state());

    package.setFunction(FunctionCode);
    package.setBody(body);


  /*  body.append(DataTypeConver::intToByteArray(m_state,1));

    body.append(DataTypeConver::intToByteArray(m_usedRamSize,4));

    body.append(DataTypeConver::intToByteArray(m_totalRamSize,4));

    body.append(DataTypeConver::intToByteArray(m_usedFlashSize,8));

    body.append(DataTypeConver::intToByteArray(m_totalFlashSize,8));

    strLength = m_runningTime.toLocal8Bit().length();
    body.append(DataTypeConver::intToByteArray(strLength,2));
    body.append(m_runningTime);

    strLength = m_ip.length();
    body.append(DataTypeConver::intToByteArray(strLength,2));
    body.append(m_ip);

    strLength = m_appVersion.length();
    body.append(DataTypeConver::intToByteArray(strLength,2));
    body.append(m_appVersion);

    body = encrypt(body,KeyType::AES);

    package.setId(m_cmdId);
    package.setFunction(FunctionCode);
    package.setBody(body);*/

    return package;
}

quint8 CtrlSWKNXProgramLed::state() const
{
    return m_state;
}

void CtrlSWKNXProgramLed::setState(const quint8 &state)
{
    m_state = state;
}
